package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.entity.Spu;
import com.example.entity.SpuVo;
import com.example.service.SpuService;
import com.example.mapper.SpuMapper;
import com.example.vo.SpuItemVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 12057
* @description 针对表【spu(spu信息)】的数据库操作Service实现
* @createDate 2024-05-13 13:32:12
*/
@Service
public class SpuServiceImpl extends ServiceImpl<SpuMapper, Spu>
    implements SpuService{
    @Override
    public List<SpuItemVo> getSpuItemByCategoryId(Integer categoryId) {
        return baseMapper.getSpuItemByCategoryId(categoryId);
    }

    @Override
    public List<SpuItemVo> getSpuItemByCategoryIdS(List<Long> idList) {
        return baseMapper.getSpuByCategoryId(idList);
    }

    @Override
    public List<SpuItemVo> getSpuItemList(String keyword) {
        return baseMapper.getSpuItemList(keyword);
    }

    @Override
    public String getSpuStoreNameById(Long storeId) {
        return baseMapper.getSpuStoreNameById(storeId);
    }

    @Override
    public String getSpuCategoryNameById(Long categoryId) {
        return baseMapper.getSpuCategoryNameById(categoryId);
    }

    @Override
    public int updateStatus(Integer status, Long spuId) {
        return baseMapper.updateStatus(status,spuId);
    }

    @Override
    public List<Spu> getExamSpuList() {
        return baseMapper.getExamSpuList();
    }

    @Override
    public int updatePublishStatus(Integer status, Long spuId) {
        return baseMapper.updatePublishStatus(status,spuId);
    }

    @Override
    public int addExamSpuToSpu(Long spuId) {
        return baseMapper.addExamSpuToSpu(spuId);
    }

    @Override
    public int addExamSkuToSku(Long spuId) {
        return baseMapper.addExamSkuToSku(spuId);
    }

    @Override
    public int addExamSpuDescToSpuDesc(Long spuId) {
        return baseMapper.addExamSpuDescToSpuDesc(spuId);
    }

    @Override
    public int addExamSpuAttrToSpuAttr(Long spuId) {
        return baseMapper.addExamSpuAttrToSpuAttr(spuId);
    }

    @Override
    public int addExamSkuAttrToSkuAttr(List<Long> skuIds) {
        return baseMapper.addExamSkuAttrToSkuAttr(skuIds);
    }

    @Override
    public int addExamSkuImagesToSkuImages(List<Long> skuIds) {
        return baseMapper.addExamSkuImagesToSkuImages(skuIds);
    }

    @Override
    public List<Long> getExamSkuIdsBySpuId(Long spuId) {
        return baseMapper.getExamSkuIdsBySpuId(spuId);
    }

    //卖家


    @Override
    public List<Spu> getStoreSpuList(Long storeId) {
        return baseMapper.getStoreSpuList(storeId);
    }

    @Override
    public Long addSpu(Spu spu) {
        return (long) baseMapper.insert(spu);
    }
}




